package com.demo.controller;

import com.demo.component.UserComponent;
import com.demo.model.Student;
import com.demo.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class StudentController {
//     //1.使用属性注入的方式获取Bean
//    @Autowired
//    private StudentService studentService;

//    //2. setter注入
//    private StudentService studentService;
//
//    @Autowired
//    public void setStudentService(StudentService studentService) {
//        this.studentService = studentService;
//    }

//    //3.构造方法注入
//    private StudentService studentService;
//    private UserComponent userComponent;
//
////    @Autowired
////    public StudentController(StudentService studentService) {
////        this.studentService = studentService;
////    }
//
//    @Autowired
//    public StudentController(StudentService studentService, UserComponent userComponent) {
//        this.studentService = studentService;
//        this.userComponent = userComponent;
//    }


//    public void sayHi(){
//        studentService.sayHi();
//    }

//    @Autowired
//    private Student student;
//
//    public void getStudent(){
//        System.out.println(student);
//        Student s=student;
//        System.out.println(s);
//    }
}
